<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
                        $table->string('name');
                        $table->string('email');
                        $table->string('login');
                        $table->string('password');
                        $table->string('remember_token')->index();
                        $table->boolean('is_admin')->default(0);
			$table->timestamps();
		});
                
                $superadmin = new User;
                $superadmin->name = 'Laurent ASENSIO';
                $superadmin->email = 'laurent@mindescape.eu';
                $superadmin->login = 'superadmin';
                $superadmin->password = Hash::make('v1rtu4l');
                $superadmin->is_admin = true;
                $superadmin->save();
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}
